package com.liwen.service.coop;

import com.liwen.api.enums.Ins;
import com.liwen.api.vo.OrderVO;
import com.liwen.service.BaseService;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

/**
 * @author: li.rui
 * @time: 2018-04-19 16:00
 * @description:
 */
@Service
public abstract class BaseBizService<T> extends BaseService {

    private T client;

    @PostConstruct
    public void init() {
        client = buildClient();
    }

    /**
     * 创建渠道客户端
     *
     * @return
     */
    abstract protected T buildClient();

    /**
     * 获取客户端实例
     *
     * @return
     */
    public T client() {
        return client;
    }

    /**
     * 渠道性质
     *
     * @return
     */
    abstract public Ins ins();


    public OrderVO getOrderInfo(String sn) {
        return null;
    }

}
